package com.java.bean;

import java.sql.Timestamp;
import java.util.Objects;

public class Courier {
    private int id;
    private String name;
    private String phone;
    private String identification;
    private String password;
    private int dispatches;
    private Timestamp regtime;
    private Timestamp logintime;
    private int status;
    private String email;
    private String addr;

    public Courier() {}

    public Courier(String name, String phone, String identification, String password, Timestamp regtime, String email, String addr) {
        this.name = name;
        this.phone = phone;
        this.identification = identification;
        this.password = password;
        this.regtime = regtime;
        this.email = email;
        this.addr = addr;
    }

    public Courier(String name, String phone, String identification, String password, int status, int dispatches, Timestamp regtime, String email, String addr) {
        this.name = name;
        this.phone = phone;
        this.identification = identification;
        this.password = password;
        this.status = status;
        this.dispatches = dispatches;
        this.regtime = regtime;
        this.email = email;
        this.addr = addr;
    }

    public Courier(String name, String phone, String identification, String password, Timestamp regtime, Timestamp logintime, String email) {
        this.name = name;
        this.phone = phone;
        this.identification = identification;
        this.password = password;
        this.regtime = regtime;
        this.logintime = logintime;
        this.email = email;
    }

    public Courier(int id, String name, String phone, String identification, String password, int dispatches, Timestamp regtime, Timestamp logintime, int status, String email) {
        this.id = id;
        this.name = name;
        this.phone = phone;
        this.identification = identification;
        this.password = password;
        this.dispatches = dispatches;
        this.regtime = regtime;
        this.logintime = logintime;
        this.status = status;
        this.email = email;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getIdentification() {
        return identification;
    }

    public void setIdentification(String identification) {
        this.identification = identification;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getDispatches() {
        return dispatches;
    }

    public void setDispatches(int dispatches) {
        this.dispatches = dispatches;
    }

    public Timestamp getRegtime() {
        return regtime;
    }

    public void setRegtime(Timestamp regtime) {
        this.regtime = regtime;
    }

    public Timestamp getLogintime() {
        return logintime;
    }

    public void setLogintime(Timestamp logintime) {
        this.logintime = logintime;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getAddr() {
        return addr;
    }

    public void setAddr(String addr) {
        this.addr = addr;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Courier courier = (Courier) o;
        return id == courier.id && dispatches == courier.dispatches && status == courier.status && Objects.equals(name, courier.name) && Objects.equals(phone, courier.phone) && Objects.equals(identification, courier.identification) && Objects.equals(password, courier.password) && Objects.equals(regtime, courier.regtime) && Objects.equals(email, courier.email);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, phone, identification, password, dispatches, regtime, status, email);
    }

    @Override
    public String toString() {
        return "Courier{" +
                "cid=" + id +
                ", cname='" + name + '\'' +
                ", cphone='" + phone + '\'' +
                ", identification='" + identification + '\'' +
                ", password='" + password + '\'' +
                ", dispatches=" + dispatches +
                ", regtime=" + regtime +
                ", logintime=" + logintime +
                ", status=" + status +
                ", cemail='" + email + '\'' +
                "}\n";
    }
}
